//
//  CommonButtonCell.swift
//  EyeVisionForDoctors
//
//  Created by PMC on 2020/3/2.
//  Copyright © 2020 tao Tao. All rights reserved.
//

import UIKit

protocol CommonButtonCellDelegate: NSObjectProtocol {
    func didTappedAction(_ cell: CommonButtonCell)
}

class CommonButtonCell: UITableViewCell {
    
    weak var delegate: CommonButtonCellDelegate?

    override func awakeFromNib() {
        super.awakeFromNib()
        backgroundColor = .clear
        contentView.backgroundColor = .clear
    }
    
    @IBOutlet weak var sureBtn: UIButton! {
        didSet {
            sureBtn.setBackgroundImage(UIImage(color: .mainColor), for: .normal)
            sureBtn.setBackgroundImage(UIImage(color: .mainLight), for: .highlighted)
            sureBtn.layer.cornerRadius = sureBtn.height / 2
            sureBtn.layer.masksToBounds = true
        }
    }
    
    @IBAction private func sureAction() {
        delegate?.didTappedAction(self)
    }
}
